#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'syxbyi'
__version__ = '1.0.0'

from os.path import join, dirname
import os
import shutil

def main():
    home = os.environ['HOME']
    dst = join(home, '.vim/templates')
    if os.path.isdir(dst):
        # make dirs recusively
        shutil.rmtree(dst)
    os.makedirs(dst)
    src = join(dirname(__file__), 'src')
    templates = os.listdir(src)
    for tem in templates:
        path = os.path.join(src, tem)
        shutil.copy(path, dst)
        print('Copy %s to %s' % (tem, dst))
    print('Done')
    return

if __name__ == '__main__':
    main()

